<%@story = story%>
<div id="<%=dom_id story%>" class="story">
	<table width="100%">
		<tr>
			<td>
				<div class="story-header">
					<div class="story-controls">
						<%= link_to "Edit Story", edit_user_story_path(current_user, story) %>
						<%= link_to_remote image_tag ("trash.gif", :border => 0), 
						:url => user_story_path(current_user, story), 
						:confirm => 'Are you sure you want to delete the Story', 
						:method => :delete %>
					</div>

					<div class="description">
						<img src="/images/new/calendar_icon.png"/><%=@story.cleaning_at.to_s(:date_time12)%>&nbsp;&nbsp;&nbsp;<label>Weight:</label>&nbsp;<%=h @story.weight%>&nbsp;lbs.
					</div>
					&nbsp;
					<%if story.expedition%>
					<div class="description">
						<label>Expedition:</label>&nbsp;<%=h story.expedition.name%>
					</div>
					<%end%>
				</div>

				<div class="story-map">	
					<%=h story.geo_location.name%>					
					<%
					map = GMap.new("map_div_#{story.id}")
					map.control_init(:small_map => true,:map_type => true)							    
					map.set_map_type_init(GMapType::G_HYBRID_MAP)      							
					geo_location  = story.geo_location
					map.center_zoom_init([geo_location.lat,geo_location.lng],8)  	  						
					marker = GMarker.new([geo_location.lat, geo_location.lng], :title => geo_location.name)  
					map.overlay_init marker							
					%>
					<%= map.to_html %>
					<%= map.div(:width => 320, :height => 220) %>
				</div>
				<label>Story:</label>
				<div class="story-blog"><%=h @story.blog%></div>
			</td>
		</tr>
		<tr>
			<td>
				<div id="<%=dom_id(story, "story_images")%>">
					<%= render :partial => "story_picture", :collection => story.pictures %>					
				</div>

					<%form_for(
					:picture,
					:url => {:action => "upload_picture"},
					:html => {
						:multipart => true, :target => dom_id(story, "upload_frame")
					}
					) do |form| %>
					<%= form.file_field :uploaded_data %><br>
					<%= hidden_field_tag :story_id, "#{story.id}"%>
					<%= submit_tag("Upload a Picture")%>
					<% end %>									
					<iframe id="<%=dom_id(story, "upload_frame")%>" name="<%=dom_id(story, "upload_frame")%>" style="width:0px;height:0px;border:0px" src="about:blank"></iframe>							
			</td>
		</tr>
	</table>
</div>
